<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>login</title>
		<link href="../../css/mui.min.css" rel="stylesheet" type="text/css" />
		<link href="../../css/app.css" rel="stylesheet" type="text/css" />
	</head>

	<body id='app'>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">找回密码</h1>
		</header>
		<div class="mui-content">
		    <form class="mui-input-group">
				<div class="mui-input-row" style="margin-top: 35px;">
					<input id='username' type="text" class="mui-input-clear mui-input" placeholder="请输入用户名">
				</div>
			</form>
			<div class="mui-content-padded" style="margin-top: 35px;">
				<button @tap='commit' id='commit' class="mui-btn main-btn-block">提交</button>
			</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/mui-extend.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init();
			var vm = new Vue({
				el:'#app',
				ready:function(){
					mui.plusReady(function () {
						showPage(plus.webview.currentWebview());
					})
				},
				methods:{
					commit:function () {
						var username = document.getElementById("username").value;
						if(tool.isEmptyVal(username)){
							mui.alert("请输入用户名！", "学园", "确定");
							return;
						}
						ajax.post(api.user.findPassword, {UserName: username},function (data) {
							mui.alert("新密码已经发送至您的邮箱！", "学园", "确定",function () {
								plus.webview.currentWebview().close();
							})
						},true);
					}
				}
			});
		</script>
	</body>

</html>